package com.ziytek.web.citizen.model.rsp;

import com.ziytek.web.citizen.constant.NumConstant;
import com.ziytek.web.citizen.constant.ServerConstant;
import com.ziytek.web.citizen.model.bean.BatteriesDetails;
import lombok.Data;

import java.util.List;

/**
 * 每个电芯充放电详情数据响应
 * @author fenghx
 * @version v1.0
 * @className QueryBatteriesDetailsResponse
 * @descripton 查询充放电电流电压详情数据
 * @date 2023/4/20 14:25
 **/
@Data
public class BatteryDetailsRsp {

    /**
     * 返回编码
     */
    private String retCode;

    /**
     * 编码描述
     */
    private String retMsg;
    /**
     * 总页数
     */
    private Integer pageNumCount;
    /**
     * 数据总量
     */
    private Integer dataCount;

//    //@Schema(name = "batteryId", description = "电芯编号")
//    private String batteryId;

    /**
     * 充放电电压数据详情
     */
    private List<BatteriesDetails> data;

    public void error() {
        this.pageNumCount = 0;
        this.dataCount = 0;
        this.retCode = ServerConstant.ERROR;
        this.retMsg = ServerConstant.ERROR_MSG;
    }

    public void error(String msg) {
        this.pageNumCount = 0;
        this.dataCount = 0;
        this.retCode = ServerConstant.ERROR;
        this.retMsg = msg;
    }

    public void success() {
        this.retCode = ServerConstant.SUCCESS;
        this.retMsg = ServerConstant.SUCCESS_MSG;
        this.dataCount = NumConstant.INT_ZERO;
        this.pageNumCount = NumConstant.INT_ZERO;
    }
}
